import {
    defultAlova, uploadAlova
} from '../index.js'
import CONFIG from "@/config.mjs";


export const getOssSignForWeb = (params={businessCode:CONFIG.BUSINESS_CODE}) => {
    const method = defultAlova.Get(`/customer/common/image/getOssSignForWeb`,{params});
    method.meta = {
    	authRole: null
        // authRole: 'login'
    };
    return method;
};
export const uploadFile = (data) =>{
    const method = uploadAlova.Post(
        data.url,
        {
            name:data.name||'file',
            filePath:data.filePath,

            // 额外数据将传入uni.uploadFile的formData中
            ...data.formData
        },
        {
            baseURL:'',
            // 设置请求方式为上传，适配器内将调用uni.uploadFile
            requestType: 'upload',
            fileType: data.fileType,
            // 开启上传进度
            enableUpload: data.enableUpload
        }
    );
    method.meta = {
        authRole: null
        // authRole: 'login'
    };
    return method;
}
